<template>
	<view class="survey-description">
		<view class="desription" v-if="!end">
			<view class="survey-title">{{title}}</view>
			<view class="survey-desc">{{desc}}</view>
			<u-button type="primary" text="参与问卷调查" @tap="startSurvey()"></u-button>
		</view>
		<view class="desription" v-else>
			<view class="end-wrapper">
				<view v-if="end.topic.endText">{{end.topic.endText}}</view>
				<u--image v-if="end.topic.image" class="end-img" width="256" height="256" radius="10px"
					:src="end.topic.image.url" />
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "survey-description",
		props: ['title', 'desc', "end"],
		data() {
			return {

			};
		},
		methods: {
			startSurvey() {
				this.$emit('start')
				this.showDesription = false
			}
		}
	}
</script>

<style lang="scss">
	.survey-description {
		height: 90vh;

		.desription {
			display: flex;
			flex-direction: column;
			align-items: left;
			width: 80vw;
			margin: auto;
			background-color: rgba(255, 255, 255, .6);
			padding: 40rpx;
			border-radius: 20rpx;

			// justify-content: space-around;

			.survey-title {
				margin-top: 20rpx;
				font-size: 32rpx;
				font-weight: 500;
				text-align: center;
				color: #4e4e4e;
			}

			.survey-desc {
				height: 60vh;
				padding: 20px 10px 20px 10px;
				margin: 20px 0;
				white-space: pre-wrap;
				font-size: 26rpx;
				background-color: #dcf2f9;
				border-radius: 20rpx;
				line-height: 30px;
				overflow-y: auto;
				letter-spacing: 2rpx;
			}
		}

		.end-wrapper {
			height: 60vh;
			text-align: center;

			.end-img {
				margin-top: 10px;
				align-items: center;
			}
		}
	}
</style>